﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CYTS.Aoyou.Framework.Log
{
    /// <summary>
    /// 消息记录者
    /// </summary>
    public class MessageLogger : Logger
    {
        private const string currentLoggerName = "CYTS.Aoyou.Framework.Log.MessageLogger";

        /// <summary>
        /// 记录消息
        /// </summary>
        /// <param name="message"></param>
        public static void Record(object message)
        {
            IMessageLog logger = GetLogger<IMessageLog>(currentLoggerName);
            if (logger.IsInfoEnabled)
            {
                logger.Record(message);
            }
        }

        public static void Record(object message, string uniqueID, string clientIP, string serverIP, string serverName, string serviceName)
        {
            IMessageLog logger = GetLogger<IMessageLog>(currentLoggerName);
            if (logger.IsInfoEnabled)
            {
                logger.Record(message, uniqueID, clientIP, serverIP, serverName, serviceName);
            }
        }
    }
}
